from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token
from .views import increments, users, skus
from rest_framework.routers import DefaultRouter

from . import views

urlpatterns = [
    url(r'^authorizations/$', obtain_jwt_token),
    # 用户总数统计
    url(r'statistical/total_count/$', increments.IncrementTotalcountView.as_view()),
    # 当天注册用户总量统计
    url(r'statistical/day_increment/$', increments.IncrementDayCountView.as_view()),
    # 获取当天登录用户总量统计
    url(r'statistical/day_active/$', increments.IncrementDayActiveView.as_view()),
    # 获取当天下单用户总量统计
    url(r'statistical/day_orders/$', increments.IncrementDayOrderView.as_view()),
    #  获取单月每天注册用户数量统计
    url(r'statistical/month_increment/$', increments.IncrementMonthCountView.as_view()),
    # 日分类商品访问量
    url(r'statistical/goods_day_views/$', increments.GoodsVisitCountView.as_view()),

    # ---------------------------------------------- 用户管理 ----------------------------------------------
    # 获取所有用户信息,用户信息查询
    url(r'users/$', users.UserView.as_view()),
]

# ------------------------------ SKU表路由------------------------------------------------
# 自动生成路由的导入方式
route = DefaultRouter()
route.register('skus', skus.SKUViewSet, base_name='skus')
urlpatterns += route.urls
